package com.yanqu.road.server.cmd.cookboy.process2;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.cookboy.CookBoyProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.cookboy.CrossCookBoyMgr;
import com.yanqu.road.server.protocol.Protocol;

/**
 * @Author : Cxp
 * @Time : 2024-12-17
 * @Description : 自动回访试吃
 */

@Cmd(code = Protocol.C_CROSS_COOK_BOY2_AUTO_JOIN_TASTE, desc = "自动回访试吃")
public class CrossCookBoy2AutoJoinCmd extends CrossCommand {

    CookBoyProto.CrossCookBoy2AutoJoinTasteMsg reqMsg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        reqMsg = CookBoyProto.CrossCookBoy2AutoJoinTasteMsg.parseFrom(packet.getBytes());

        CookBoyProto.CrossCookBoy2AutoJoinInfoMsg autoJoinInfo = reqMsg.getAutoJoinInfo();
        int activityId = autoJoinInfo.getHostActivityId();
        CrossCookBoyMgr.autoJoinTaste(serverId, activityId, reqMsg);
    }

    @Override
    public void sendData() {}
}